<?php

    // TITLE:
    // FILE:
    // AUTHOR:

?>
<h3>Address</h3>
<input type="text" name="street1" value="<?php echo $address->getStreet1(); ?>" placeholder="Street 1" onchange="update(<?php echo $id; ?>, 'street1')"><br>
<input type="text" name="street2" value="<?php echo $address->getStreet2(); ?>" placeholder="Street 2" onchange="update(<?php echo $id; ?>, 'street2')"><br>
<input type="text" name="city" value="<?php echo $address->getCity(); ?>" placeholder="City" onchange="update(<?php echo $id; ?>, 'city')">, 
<select name="state" onchange="update(<?php echo $id; ?>, 'state')">
<?php
    foreach ($states as $state) {
        $id = $state->getId();
        $abb = $state->getAbbreviation();
        $stateId = $address->getState()->getId();
        $selected = ($id == $stateId) ? ' selected="selected"' : null;
        echo '<option value="' . $id . '"' . $selected . '>' . $abb . '</option>';
    }
?>
</select> 
<input type="text" name="zip" value="<?php echo $address->getZip(); ?>" placeholder="Zip Code" onchange="update(<?php echo $id; ?>, 'zip')"><br>
